#ifndef INFINITY_PLANET_CACHE_H
#	define INFINITY_PLANET_CACHE_H

#include "planet.h"

namespace infinity {

class Planet::Cache
{
public : //! @name Construction & Destruction
	//! @{
	Cache(const Vector3i& capacity);
	~Cache();
	//! @}

public : //! @name Commands
	//! @{
	void resize(const Vector3i& capacity);
	void invalidate();
	void prefetch(const Planet* planet, const Vector3i& origin, const Vector3i& dimensions);
	//! @}

public : //! @name State
	//! @{
	bool isValid() const ;
	void getCell(const Vector3i& position, Cell& cell) const ;
	//! @}

private : //! @name Data
	//! @{
	Vector3i m_capacity;
	Vector3i m_origin;
	Vector3i m_dimensions;
	bool m_isValid;
	Cell* m_cells;
	//! @}
};

} // namespace infinity

#endif // !INFINITY_PLANET_CACHE_H
